import request from '@/utils/request';

const PRE_URL = '/forecast/scheduler';
/**
 * 根据Id获取
 * @param {*} params
 */
export async function getById(id) {
  return request(`${PRE_URL}/getById`, {
    method: 'POST',
    data: {
      id,
    },
  });
}

export async function fetchProgress(params) {
  return request(`${PRE_URL}/getByPage`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function updateProgressStatusByParams(params) {
  return request(`${PRE_URL}/updateStatusByParams`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function sendInstructionByParams(params) {
  return request(`${PRE_URL}/sendInstructionByParams`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function importData(params) {
  return request(`${PRE_URL}/importData`, {
    method: 'POST',
    data: params,
  });
}
export async function add(params) {
  return request(`${PRE_URL}/add`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function update(params) {
  return request(`${PRE_URL}/update`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 查询
 * @param {*} params
 */
export async function getByPage(params) {
  return request(`${PRE_URL}/getByPage`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

export async function deleteById(id) {
  return request(`${PRE_URL}/deleteById`, {
    method: 'POST',
    data: {
      id,
    },
  });
}
